<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>MC-GPU: MC-GPU_v1.3.cu File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MC-GPU
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('MC-GPU__v1_83_8cu.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">MC-GPU_v1.3.cu File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="MC-GPU__v1_83_8cu_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Main program of MC-GPU: initialize the simulation enviroment, launch the GPU kernels that perform the x ray transport and report the final results.  <a href="#a3c04138a5bfe5d72780bb7e82a18e627"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a04125b2129832959744717839c968ebb">read_input</a> (int argc, char **argv, int myID, unsigned long long int *total_histories, int *seed_input, int *gpu_id, int *num_threads_per_block, int *histories_per_thread, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data, unsigned long long int **image_ptr, int *image_bytes, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data, struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *source_energy_data, char *file_name_voxels, char file_name_materials[<a class="el" href="MC-GPU__v1_83_8h.html#a7aa308231ff3dcfd43ac19023e2e6e15">MAX_MATERIALS</a>][250], char *file_name_output, char *file_name_espc, int *num_projections, double *D_angle, double *angularROI_0, double *angularROI_1, double *initial_angle, <a class="el" href="structulonglong2.html">ulonglong2</a> **voxels_Edep_ptr, int *voxels_Edep_bytes, char *file_dose_output, short int *dose_ROI_x_min, short int *dose_ROI_x_max, short int *dose_ROI_y_min, short int *dose_ROI_y_max, short int *dose_ROI_z_min, short int *dose_ROI_z_max, double *SRotAxisD, double *vertical_translation_per_projection, int *flag_material_dose)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the input file given in the command line and return the significant data.  <a href="#a04125b2129832959744717839c968ebb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a96dba25b308814b25fbae71e27617f12">trim_name</a> (char *input_line, char *file_name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract a file name from an input text line, trimming the initial blanks, trailing comment (#) and stopping at the first blank (the file name should not contain blanks).  <a href="#a96dba25b308814b25fbae71e27617f12"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#aea168bca1466813e03b649931a4f670f">fgets_trimmed</a> (char *trimmed_line, int num, FILE *file_ptr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a line of text and trim initial blancks and trailing comments (#).  <a href="#aea168bca1466813e03b649931a4f670f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#aed61d205baa31cea69768bbd68c062c6">load_voxels</a> (int myID, char *file_name_voxels, float *density_max, struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *voxel_data, <a class="el" href="structfloat2.html">float2</a> **voxel_mat_dens_ptr, unsigned int *voxel_mat_dens_bytes, short int *dose_ROI_x_max, short int *dose_ROI_y_max, short int *dose_ROI_z_max)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the voxel data and allocate the material and density matrix.  <a href="#aed61d205baa31cea69768bbd68c062c6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a55f3171a6cdb59fc43e65aa19c676d80">load_material</a> (int myID, char file_name_materials[<a class="el" href="MC-GPU__v1_83_8h.html#a7aa308231ff3dcfd43ac19023e2e6e15">MAX_MATERIALS</a>][250], float *density_max, float *density_nominal, struct <a class="el" href="structlinear__interp.html">linear_interp</a> *mfp_table_data, <a class="el" href="structfloat2.html">float2</a> **mfp_Woodcock_table_ptr, int *mfp_Woodcock_table_bytes, <a class="el" href="structfloat3.html">float3</a> **mfp_table_a_ptr, <a class="el" href="structfloat3.html">float3</a> **mfp_table_b_ptr, int *mfp_table_bytes, struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *rayleigh_table_ptr, struct <a class="el" href="structcompton__struct.html">compton_struct</a> *compton_table_ptr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the material input files and set the mean free paths and the "linear_interp" structures.  <a href="#a55f3171a6cdb59fc43e65aa19c676d80"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#aa23f71412757b1d0e1d4c00e6b8a0c18">report_image</a> (char *file_name_output, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data, float mean_energy_spectrum, unsigned long long int *image, double time_elapsed, unsigned long long int total_histories, int current_projection, int num_projections, double D_angle, double initial_angle, int myID, int numprocs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the tallied image in ASCII and binary form (32-bit floats).  <a href="#aa23f71412757b1d0e1d4c00e6b8a0c18"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#aeceeb305fc1d995c4730e0fcedf10d0c">report_voxels_dose</a> (char *file_dose_output, int num_projections, struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *voxel_data, <a class="el" href="structfloat2.html">float2</a> *voxel_mat_dens, <a class="el" href="structulonglong2.html">ulonglong2</a> *voxels_Edep, double time_total_MC_init_report, unsigned long long int total_histories, short int dose_ROI_x_min, short int dose_ROI_x_max, short int dose_ROI_y_min, short int dose_ROI_y_max, short int dose_ROI_z_min, short int dose_ROI_z_max, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the total tallied 3D voxel dose deposition for all projections.  <a href="#aeceeb305fc1d995c4730e0fcedf10d0c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#aa02ffc836f2b6f9de5386cadb11e30b7">report_materials_dose</a> (int num_projections, unsigned long long int total_histories, float *density_nominal, <a class="el" href="structulonglong2.html">ulonglong2</a> *materials_dose, double *mass_materials)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the tallied dose to each material number, accounting for different densities in different regions with the same material number.  <a href="#aa02ffc836f2b6f9de5386cadb11e30b7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a5f62e6c0430761bba20f1e546d396a27">set_CT_trajectory</a> (int myID, int num_projections, double D_angle, double angularROI_0, double angularROI_1, double SRotAxisD, struct <a class="el" href="structsource__struct.html">source_struct</a> *source_data, struct <a class="el" href="structdetector__struct.html">detector_struct</a> *detector_data, double vertical_translation_per_projection)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the CT trajectory: store in memory the source and detector rotations that are needed to calculate the multiple projections.  <a href="#a5f62e6c0430761bba20f1e546d396a27"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a6577c51b64b94b13c4e95df776275b5a">update_seed_PRNG</a> (int batch_number, unsigned long long int total_histories, int *seed)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the first seed of the pseudo-random number generator (PRNG) RANECU to a position far away from the previous history (leap frog technique).  <a href="#a6577c51b64b94b13c4e95df776275b5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#ac1d6abb26890276f529eed6b7ceafe89">init_energy_spectrum</a> (char *file_name_espc, struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *source_energy_data, float *mean_energy_spectrum)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the energy spectrum file and initialize the Walker aliasing sampling.  <a href="#ac1d6abb26890276f529eed6b7ceafe89"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#a0b858ab906084d4426bfe5b522074e2c">seeki_walker</a> (float *cutoff, short int *alias, float randno, int n)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the interval (x(i),x(i+1)] containing the input value using Walker's aliasing method.  <a href="#a0b858ab906084d4426bfe5b522074e2c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MC-GPU__v1_83_8cu.html#ac2eacae33c0451f6a23fdf1101c6ca11">IRND0</a> (float *W, float *F, short int *K, int N)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialisation of Walker's aliasing algorithm for random sampling from discrete probability distributions.  <a href="#ac2eacae33c0451f6a23fdf1101c6ca11"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Andreu Badal (<a href="mailto:Andreu.Badal-Soler@fda.hhs.gov">Andreu.Badal-Soler@fda.hhs.gov</a>) </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>2012/12/12 -- MC-GPU v.1.3: 2012/12/12 -- MC-GPU v.1.2: 2011/10/25 -- MC-GPU v.1.1: 2010/06/25 -- MC-GPU v.1.0: 2009/03/17 </dd></dl>

<p>Definition in file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="aea168bca1466813e03b649931a4f670f"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::fgets_trimmed" ref="aea168bca1466813e03b649931a4f670f" args="(char *trimmed_line, int num, FILE *file_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* <a class="el" href="MC-GPU__v1_83_8h.html#aea168bca1466813e03b649931a4f670f">fgets_trimmed</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>trimmed_line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>file_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read a line of text and trim initial blancks and trailing comments (#). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>Characters to read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">file_ptr</td><td>Pointer to the input file stream </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">trimmed_line</td><td>Trimmed line from input file, skipping empty lines and comments </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01868">1868</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>, and <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>.</p>

</div>
</div>
<a class="anchor" id="ac1d6abb26890276f529eed6b7ceafe89"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::init_energy_spectrum" ref="ac1d6abb26890276f529eed6b7ceafe89" args="(char *file_name_espc, struct source_energy_struct *source_energy_data, float *mean_energy_spectrum)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ac1d6abb26890276f529eed6b7ceafe89">init_energy_spectrum</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_espc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *&#160;</td>
          <td class="paramname"><em>source_energy_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>mean_energy_spectrum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the energy spectrum file and initialize the Walker aliasing sampling. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_espc</td><td>File containing the energy spectrum (lower energy value in each bin and its emission probability). </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">source_energy_data</td><td>Energy spectrum and other source data. The Walker alias and cutoffs are initialized in this function. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mean_energy_spectrum</td><td>Mean energy in the input x-ray energy spectrum. </td></tr>
  </table>
  </dd>
</dl>
<p>!Walker!! Calling PENELOPE's function to init the Walker method </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">3398</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00180">source_energy_struct::espc_alias</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc_cutoff</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01868">fgets_trimmed()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03575">IRND0()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00068">MAX_ENERGY_BINS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00093">max_value</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00177">source_energy_struct::num_bins_espc</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="ac2eacae33c0451f6a23fdf1101c6ca11"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::IRND0" ref="ac2eacae33c0451f6a23fdf1101c6ca11" args="(float *W, float *F, short int *K, int N)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ac2eacae33c0451f6a23fdf1101c6ca11">IRND0</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>W</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>F</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>K</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>N</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialisation of Walker's aliasing algorithm for random sampling from discrete probability distributions. </p>
<p>Input arguments: N ........ number of different values of the random variable. W(1:N) ... corresponding point probabilities (not necessarily normalised to unity). Output arguments: F(1:N) ... cutoff values. K(1:N) ... alias values.</p>
<p>This subroutine is part of the PENELOPE 2006 code developed by Francesc Salvat at the University of Barcelona. For more info: www.oecd-nea.org/science/pubs/2009/nea6416-penelope.pdf </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03575">3575</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>.</p>

</div>
</div>
<a class="anchor" id="a55f3171a6cdb59fc43e65aa19c676d80"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::load_material" ref="a55f3171a6cdb59fc43e65aa19c676d80" args="(int myID, char file_name_materials[MAX_MATERIALS][250], float *density_max, float *density_nominal, struct linear_interp *mfp_table_data, float2 **mfp_Woodcock_table_ptr, int *mfp_Woodcock_table_bytes, float3 **mfp_table_a_ptr, float3 **mfp_table_b_ptr, int *mfp_table_bytes, struct rayleigh_struct *rayleigh_table_ptr, struct compton_struct *compton_table_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ad23b50cb34b4aadcd24d9fec7e47ad24">load_material</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>file_name_materials</em>[MAX_MATERIALS][250], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_nominal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structlinear__interp.html">linear_interp</a> *&#160;</td>
          <td class="paramname"><em>mfp_table_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> **&#160;</td>
          <td class="paramname"><em>mfp_Woodcock_table_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>mfp_Woodcock_table_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> **&#160;</td>
          <td class="paramname"><em>mfp_table_a_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat3.html">float3</a> **&#160;</td>
          <td class="paramname"><em>mfp_table_b_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>mfp_table_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structrayleigh__struct.html">rayleigh_struct</a> *&#160;</td>
          <td class="paramname"><em>rayleigh_table_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcompton__struct.html">compton_struct</a> *&#160;</td>
          <td class="paramname"><em>compton_table_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the material input files and set the mean free paths and the "linear_interp" structures. </p>
<p>Find the material nominal density. Set the Woodcock trick data. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_materials</td><td>Array with the names of the material files. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">density_max</td><td>maximum density in the geometry (needed to set Woodcock trick) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">density_nominal</td><td>Array with the nominal density of the materials read </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mfp_table_data</td><td>Constant values for the linear interpolation </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mfp_table_a_ptr</td><td>First element for the linear interpolation. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mfp_table_b_ptr</td><td>Second element for the linear interpolation. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">2110</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::aco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::bco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::e0</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::fco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::fj0</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::ide</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00259">rayleigh_struct::itlco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00259">rayleigh_struct::ituco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00065">MAX_ENERGYBINS_RAYLEIGH</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00063">MAX_SHELLS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00244">compton_struct::noscco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00064">NP_RAYLEIGH</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00228">linear_interp::num_values</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::pco</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::pmax</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00241">compton_struct::uico</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00254">rayleigh_struct::xco</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aed61d205baa31cea69768bbd68c062c6"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::load_voxels" ref="aed61d205baa31cea69768bbd68c062c6" args="(int myID, char *file_name_voxels, float *density_max, struct voxel_struct *voxel_data, float2 **voxel_mat_dens_ptr, unsigned int *voxel_mat_dens_bytes, short int *dose_ROI_x_max, short int *dose_ROI_y_max, short int *dose_ROI_z_max)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#aed61d205baa31cea69768bbd68c062c6">load_voxels</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_voxels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *&#160;</td>
          <td class="paramname"><em>voxel_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> **&#160;</td>
          <td class="paramname"><em>voxel_mat_dens_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>voxel_mat_dens_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_x_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_y_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_z_max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the voxel data and allocate the material and density matrix. </p>
<p>Also find and report the maximum density defined in the geometry. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_voxels</td><td>Name of the voxelized geometry file. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">density_max</td><td>Array with the maximum density for each material in the voxels. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">voxel_data</td><td>Pointer to a structure containing the voxel number and size. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">voxel_mat_dens_ptr</td><td>Pointer to the vector with the voxel materials and densities. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dose_ROI_x/y/z_max</td><td>Size of the dose ROI: can not be larger than the total number of voxels in the geometry. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01929">1929</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::inv_voxel_size</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00094">min_value</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00215">voxel_struct::num_voxels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::size_bbox</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::z</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a3c04138a5bfe5d72780bb7e82a18e627"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::main" ref="a3c04138a5bfe5d72780bb7e82a18e627" args="(int argc, char **argv)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8cu.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Main program of MC-GPU: initialize the simulation enviroment, launch the GPU kernels that perform the x ray transport and report the final results. </p>
<p>This function reads the description of the simulation from an external file given in the command line. This input file defines the number of particles to simulate, the characteristics of the x-ray source and the detector, the number and spacing of the projections (if simulating a CT), the location of the material files containing the interaction mean free paths, and the location of the voxelized geometry file.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Andreu Badal </dd></dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">377</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_x_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_x_min_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_y_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_y_min_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_z_max_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00311">dose_ROI_z_min_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::e0</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00178">source_energy_struct::espc</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00229">linear_interp::ide</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03398">init_energy_spectrum()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::inv_voxel_size</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02110">load_material()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01929">load_voxels()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00335">mfp_table_data_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00177">source_energy_struct::num_bins_espc</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00228">linear_interp::num_values</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00215">voxel_struct::num_voxels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02715">report_image()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03128">report_materials_dose()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02890">report_voxels_dose()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00194">detector_struct::sdd</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">set_CT_trajectory()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00341">source_energy_data_CONST</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00135">track_particles()</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03356">update_seed_PRNG()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00317">voxel_data_CONST</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::z</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

</div>
</div>
<a class="anchor" id="a04125b2129832959744717839c968ebb"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::read_input" ref="a04125b2129832959744717839c968ebb" args="(int argc, char **argv, int myID, unsigned long long int *total_histories, int *seed_input, int *gpu_id, int *num_threads_per_block, int *histories_per_thread, struct detector_struct *detector_data, unsigned long long int **image_ptr, int *image_bytes, struct source_struct *source_data, struct source_energy_struct *source_energy_data, char *file_name_voxels, char file_name_materials[MAX_MATERIALS][250], char *file_name_output, char *file_name_espc, int *num_projections, double *D_angle, double *angularROI_0, double *angularROI_1, double *initial_angle, ulonglong2 **voxels_Edep_ptr, int *voxels_Edep_bytes, char *file_dose_output, short int *dose_ROI_x_min, short int *dose_ROI_x_max, short int *dose_ROI_y_min, short int *dose_ROI_y_max, short int *dose_ROI_z_min, short int *dose_ROI_z_max, double *SRotAxisD, double *vertical_translation_per_projection, int *flag_material_dose)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#ad3f14826495baa5f44c9f830572c4bcd">read_input</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int *&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>seed_input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>gpu_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>num_threads_per_block</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>histories_per_thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int **&#160;</td>
          <td class="paramname"><em>image_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>image_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__energy__struct.html">source_energy_struct</a> *&#160;</td>
          <td class="paramname"><em>source_energy_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_voxels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>file_name_materials</em>[MAX_MATERIALS][250], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_espc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>D_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>angularROI_0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>angularROI_1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>initial_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> **&#160;</td>
          <td class="paramname"><em>voxels_Edep_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>voxels_Edep_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_dose_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_x_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_x_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_y_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_y_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_z_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>dose_ROI_z_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>SRotAxisD</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>vertical_translation_per_projection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>flag_material_dose</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read the input file given in the command line and return the significant data. </p>
<p>Example input file:</p>
<p>1000000 [Total number of histories to simulate] geometry.vox [Voxelized geometry file name] material.mat [Material data file name]</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">argc</td><td>Command line parameters </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">argv</td><td>Command line parameters: name of input file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">total_histories</td><td>Total number of particles to simulate </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">seed_input</td><td>Input random number generator seed </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">num_threads_per_block</td><td>Number of CUDA threads for each GPU block </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">detector_data</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">image</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source_data</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name_voxels</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name_materials</td><td></td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name_output</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">1242</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::center</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::corner_min_rotated_to_Y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00161">source_struct::cos_theta_low</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00073">DEG2RAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01868">fgets_trimmed()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::height_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00059">MAX_NUM_PROJECTIONS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00071">PI</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::rot_inv</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::rotation_flag</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00194">detector_struct::sdd</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::total_num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01840">trim_name()</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::width_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aa23f71412757b1d0e1d4c00e6b8a0c18"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::report_image" ref="aa23f71412757b1d0e1d4c00e6b8a0c18" args="(char *file_name_output, struct detector_struct *detector_data, struct source_struct *source_data, float mean_energy_spectrum, unsigned long long int *image, double time_elapsed, unsigned long long int total_histories, int current_projection, int num_projections, double D_angle, double initial_angle, int myID, int numprocs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#aa23f71412757b1d0e1d4c00e6b8a0c18">report_image</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>mean_energy_spectrum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>time_elapsed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>current_projection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>D_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>initial_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numprocs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Report the tallied image in ASCII and binary form (32-bit floats). </p>
<p>Separate images for primary and scatter radiation are generated.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name_output</td><td>File where tallied image is reported </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">detector_data</td><td>Detector description read from the input file (pointer to <a class="el" href="structdetector__struct.html" title="Structure storing the data defining the x-ray detector.">detector_struct</a>) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>Tallied image (in meV per pixel) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">time_elapsed</td><td>Time elapsed during the main loop execution (in seconds) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Total number of x-rays simulated </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02715">2715</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00130">int2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aa02ffc836f2b6f9de5386cadb11e30b7"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::report_materials_dose" ref="aa02ffc836f2b6f9de5386cadb11e30b7" args="(int num_projections, unsigned long long int total_histories, float *density_nominal, ulonglong2 *materials_dose, double *mass_materials)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#aa02ffc836f2b6f9de5386cadb11e30b7">report_materials_dose</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>density_nominal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>materials_dose</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>mass_materials</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Report the tallied dose to each material number, accounting for different densities in different regions with the same material number. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num_projections</td><td>Number of projections simulated </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Total number of x-rays simulated per projection </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">density_nominal</td><td>Array with the nominal densities of materials given in the input file; -1 for materials not defined. Used to report only defined materials. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">materials_dose</td><td>Tallied dose and dose^2 arrays </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03128">3128</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aeceeb305fc1d995c4730e0fcedf10d0c"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::report_voxels_dose" ref="aeceeb305fc1d995c4730e0fcedf10d0c" args="(char *file_dose_output, int num_projections, struct voxel_struct *voxel_data, float2 *voxel_mat_dens, ulonglong2 *voxels_Edep, double time_total_MC_init_report, unsigned long long int total_histories, short int dose_ROI_x_min, short int dose_ROI_x_max, short int dose_ROI_y_min, short int dose_ROI_y_max, short int dose_ROI_z_min, short int dose_ROI_z_max, struct source_struct *source_data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#ac91d2c9046a60b6d7f225c573c4d4d98">report_voxels_dose</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_dose_output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structvoxel__struct.html">voxel_struct</a> *&#160;</td>
          <td class="paramname"><em>voxel_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfloat2.html">float2</a> *&#160;</td>
          <td class="paramname"><em>voxel_mat_dens</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structulonglong2.html">ulonglong2</a> *&#160;</td>
          <td class="paramname"><em>voxels_Edep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>time_total_MC_init_report</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_x_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_x_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_y_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_y_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_z_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int&#160;</td>
          <td class="paramname"><em>dose_ROI_z_max</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Report the total tallied 3D voxel dose deposition for all projections. </p>
<p>The voxel doses in the input ROI and their respective uncertainties are reported in binary form (32-bit floats) in two separate .raw files. The dose in a single plane at the level of the focal spot is also reported in ASCII format for simple visualization with GNUPLOT. The total dose deposited in each different material is reported to the standard output. The material dose is calculated adding the energy deposited in the individual voxels within the dose ROI, and dividing by the total mass of the material in the ROI.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_dose_output</td><td>File where tallied image is reported </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">detector_data</td><td>Detector description read from the input file (pointer to <a class="el" href="structdetector__struct.html" title="Structure storing the data defining the x-ray detector.">detector_struct</a>) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">image</td><td>Tallied image (in meV per pixel) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">time_elapsed</td><td>Time elapsed during the main loop execution (in seconds) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Total number of x-rays simulated </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source_data</td><td>Data required to compute the voxel plane to report in ASCII format: Z at the level of the source, 1st projection </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l02890">2890</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00216">voxel_struct::inv_voxel_size</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00062">MAX_MATERIALS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00215">voxel_struct::num_voxels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00079">SCALE_eV</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00137">ulonglong2::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00131">int3::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00132">float2::y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a0b858ab906084d4426bfe5b522074e2c"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::seeki_walker" ref="a0b858ab906084d4426bfe5b522074e2c" args="(float *cutoff, short int *alias, float randno, int n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="MC-GPU__v1_83_8h.html#a0b858ab906084d4426bfe5b522074e2c">seeki_walker</a> </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>cutoff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short int *&#160;</td>
          <td class="paramname"><em>alias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>randno</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Finds the interval (x(i),x(i+1)] containing the input value using Walker's aliasing method. </p>
<p>Input: cutoff(1..n) -&gt; interval cutoff values for the Walker method cutoff(1..n) -&gt; alias for the upper part of each interval randno -&gt; point to be located n -&gt; no. of data points Output: index i of the semiopen interval where randno lies Comments: -&gt; The cutoff and alias values have to be previously initialised calling the penelope subroutine IRND0.</p>
<p>Algorithm implementation based on the PENELOPE code developed by Francesc Salvat at the University of Barcelona. For more info: www.oecd-nea.org/science/pubs/2009/nea6416-penelope.pdf </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03526">3526</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

</div>
</div>
<a class="anchor" id="a5f62e6c0430761bba20f1e546d396a27"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::set_CT_trajectory" ref="a5f62e6c0430761bba20f1e546d396a27" args="(int myID, int num_projections, double D_angle, double angularROI_0, double angularROI_1, double SRotAxisD, struct source_struct *source_data, struct detector_struct *detector_data, double vertical_translation_per_projection)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a5f62e6c0430761bba20f1e546d396a27">set_CT_trajectory</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>myID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_projections</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>D_angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>angularROI_0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>angularROI_1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>SRotAxisD</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structsource__struct.html">source_struct</a> *&#160;</td>
          <td class="paramname"><em>source_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structdetector__struct.html">detector_struct</a> *&#160;</td>
          <td class="paramname"><em>detector_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>vertical_translation_per_projection</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the CT trajectory: store in memory the source and detector rotations that are needed to calculate the multiple projections. </p>
<p>The first projection (0) was previously initialized in function "read_input".</p>
<p>ASSUMPTIONS: the CT scan plane must be perpendicular to the Z axis, ie, the initial direction of the particles must have w=0! </p>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03194">3194</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::center</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00195">detector_struct::corner_min_rotated_to_Y</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::direction</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::height_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::inv_pixel_size_Z</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00056">MASTER_THREAD</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00059">MAX_NUM_PROJECTIONS</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00202">detector_struct::num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00071">PI</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00159">source_struct::position</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00072">RAD2DEG</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::rot_inv</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::rotation_flag</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00194">detector_struct::sdd</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00203">detector_struct::total_num_pixels</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00197">detector_struct::width_X</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::x</a>, <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::y</a>, and <a class="el" href="MC-GPU__v1_83_8h_source.html#l00133">float3::z</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a96dba25b308814b25fbae71e27617f12"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::trim_name" ref="a96dba25b308814b25fbae71e27617f12" args="(char *input_line, char *file_name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a96dba25b308814b25fbae71e27617f12">trim_name</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>input_line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>file_name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Extract a file name from an input text line, trimming the initial blanks, trailing comment (#) and stopping at the first blank (the file name should not contain blanks). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">input_line</td><td>Input sentence with blanks and a trailing comment </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">file_name</td><td>Trimmed file name </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01840">1840</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l01242">read_input()</a>.</p>

</div>
</div>
<a class="anchor" id="a6577c51b64b94b13c4e95df776275b5a"></a><!-- doxytag: member="MC&#45;GPU_v1.3.cu::update_seed_PRNG" ref="a6577c51b64b94b13c4e95df776275b5a" args="(int batch_number, unsigned long long int total_histories, int *seed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="MC-GPU__v1_83_8h.html#a6577c51b64b94b13c4e95df776275b5a">update_seed_PRNG</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>batch_number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long long int&#160;</td>
          <td class="paramname"><em>total_histories</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>seed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the first seed of the pseudo-random number generator (PRNG) RANECU to a position far away from the previous history (leap frog technique). </p>
<p>This function is equivalent to "init_PRNG" but only updates one of the seeds.</p>
<p>Note that if we use the same seed number to initialize the 2 MLCGs of the PRNG we can only warranty that the first MLCG will be uncorrelated for each value generated by "update_seed_PRNG". There is a tiny chance that the final PRNs will be correlated because the leap frog on the first MLCG will probably go over the repetition cycle of the MLCG, which is much smaller than the full RANECU. But any correlataion is extremely unlikely. Function "init_PRNG" doesn't have this issue.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">batch_number</td><td>Elements to skip (eg, MPI thread_number). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">total_histories</td><td>Histories to skip. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">seed</td><td>Initial PRNG seeds; returns the updated seed. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="MC-GPU__v1_83_8cu_source.html#l03356">3356</a> of file <a class="el" href="MC-GPU__v1_83_8cu_source.html">MC-GPU_v1.3.cu</a>.</p>

<p>References <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00814">a1_RANECU</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00919">abMODm()</a>, <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00812">LEAP_DISTANCE</a>, and <a class="el" href="MC-GPU__kernel__v1_83_8cu_source.html#l00815">m1_RANECU</a>.</p>

<p>Referenced by <a class="el" href="MC-GPU__v1_83_8cu_source.html#l00377">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="MC-GPU__v1_83_8cu.html">MC-GPU_v1.3.cu</a>      </li>

    <li class="footer">Generated on Mon Dec 17 2012 13:26:39 for MC-GPU by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
